package com.hehe.controller;


import com.hehe.POJO.T_user;
import com.hehe.Service.T_User_Service;
import jakarta.annotation.Resource;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
@RequestMapping("/users")
public class T_User {

    @Resource
    private T_User_Service t_user_service;


    @GetMapping
    public String listUsers(@RequestParam(defaultValue = "0") int page,
                            @RequestParam(defaultValue = "5") int size,
                            Model model) {
        Page<T_user> data = t_user_service.getUsersByStatus((byte) 0, page, size);
        model.addAttribute("userPage", data);
        return "users.html";
    }






}


